package com.joysuch.wwyt.datadump.biz.convertor;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import org.springframework.stereotype.Component;

/**
 * @Author ZhaoQiuWei
 * @Date 2022/1/21 18:24
 */
@Component
public class ImportYesNoToNumberConvertor implements FieldValueConvert<String, Integer> {

    @Override
    public Integer convert(Object bean, String value, DataDumpField dataField) {
        if ("是".equals(value) || "Y".equals(value)) {
            return 1;
        }
        return 0;
    }

}
